package com.example.weather_news.view;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.example.weather_news.R;

import java.text.SimpleDateFormat;
import java.util.Date;

public class LoadingDialog {

	public static Dialog dialog;
	public static Date data;
	public static SimpleDateFormat format;

	public static void showDialog(Context context){
		AlertDialog.Builder builder =new AlertDialog.Builder(context, AlertDialog.THEME_HOLO_LIGHT);
		View view= LayoutInflater.from(context).inflate(R.layout.loading_dialog,null);
		builder.setView(view);
		builder.setCancelable(false);
		dialog=builder.create();
		dialog.show();
	}
	public static void disDialog(){
		dialog.dismiss();
	}
	
	public static String getTime(){
		data=new Date(System.currentTimeMillis());
		format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String string=format.format(data);
		return string;
	}
}
